<template>
	<div><input type="text" v-model="name"/></div>
	<div><input type="password" v-model="password"/></div>
	<div class="registerBtn" @click="register">注册</div>
</template>

<script setup>
	import {ref} from "vue"
	import http from "../../request.js"
	import {useRouter} from "vue-router"
	const name =ref("")
	const password =ref("")
	const router = useRouter()
	function register(){
		http.post("/user/register",{name:name.value,password:password.value}).then(res=>{
			if(res.data==true){
				router.push("/login")
			}
		})
	}
</script>

<style>
</style>